#include <stdio.h>
#include <string.h>
#include "main.h"

int convert(char *binary) {
	int dec = 0;
	int size = strlen(binary);
	int i;

	for(i=0; i < size; i++) {
		dec |= (binary[i] - '0');
		if(i < size-1)
			dec <<= 1;
	}
	return dec;
}
char * verify(char *bin) {
	char *addr;

	addr = bin;
	while(*bin) {
		if(*bin != '0' && *bin != '1') {
			addr = NULL;
			break;
		}
		bin++;
	}
	return addr;
}
